<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php");         // 引入通用的设置文件 ?>
<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/module/head.php"); // 引入通用的头部 ?>
<?php include_once("../controller/data_list.php");                     // 当前页面的控制器 ?>
<body>
<!--顶部栏-->
<div id="topbar"> <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?></div>
<!--容器-->
<div id="container" class="<? echo $now_extender ?>">
    <!--侧边栏-->
    <div id="sidebar"><?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?></div>
    <!--主内容-->
    <div id="content">
        <!--标题设定-->
        <?php $page_title=$_plate['name'].'列表';?>
        <?php include ROOT_PATH_ . '/controller/common/module/mod-page-title.php'; ?>
        <!--搜索框-->
        <?php include 'module/mod-search.php'; ?>

        <?//============================================?>
        <?//以下开发需要注重的部分，主要写前端?>
        <?//============================================?>



            <!-- 用$now_extender .list_boxe来控制来到确认板块信息显示-->
            <div class="list-box">

                <div class="shrinker">这些都是用来给接口获取信息，已经整理好内容，用于给接口发布的推文</div>
                    <table class="layui-table layui-form">
                        <colgroup>
                            <col width="20" >
                            <col width="180" >
                            <col  >
                            <col width="90" >
                            <col  >
                            <col width="90" >
                            <col width="180" >
                            <col width="250" >
                        </colgroup>
                        <thead>
                        <tr>
                            <th  class="layui-table-cell">
                                <input type="checkbox" lay-skin="primary" lay-filter="check_all_checkbox" id="check_all_checkbox" >
                            </th>
                            <th><div class="els2">账号</div></th>
                            <th><div class="els2">内容</div></th>
                            <th><div class="els2">标签</div></th>
                            <th><div class="els2">媒体</div></th>
                            <th><div class="els2">发布状态</div></th>
                            <th><div class="els2">发布时间</div></th>
                            <th><div class="els2">操作</div></th>

                        </tr>
                        </thead>
                        <tbody>


                        <?php for ($i = 0; $i < $_quantity_per_page; $i++) {?>

                            <tr id="item<? echo $_list[$i]['nid'] ?>">

                                <td id="<? echo $i + 1 + $plate['page_list_num'] * ($nowpageid - 1) ?>" class="layui-table-cell">
                                        <input type="checkbox" name="nid[]" lay-skin="primary" lay-filter="item_checkbox"  value="<? echo $_list[$i]['nid'] ?>">
                                </td>

                                <td><div class="els2"><? echo $_list[$i]['name'] ?></div></td>

                                <td><div class="els2"><? echo $_list[$i]['content'] ?></div></td>


                                <td><? echo $_list[$i]['tag'] ?></td>
                                <td><? echo $_list[$i]['media'] ?></td>
                                <td><? echo $_list[$i]['publish_status'] ?>
                                <td><? echo $_list[$i]['publish_date'] ?>
                                </td>

                                <td>


                                    <span onclick="window_eject('data_edit_window.php?<? echo $data['url_parameter'] ?>&nid=<? echo $_list[$i]['nid'] ?>')"
                                       class="layui-btn  layui-btn-sm">
                                        <i class="fa fa-bar-chart-o" aria-hidden="true"></i>修改
                                    </span>

                                    <a onclick="window_eject('data_info_window.php?<? echo $data['url_parameter'] ?>&nid=<? echo $_list[$i]['nid'] ?>')"
                                       class="layui-btn  layui-btn-sm">
                                        <i class="fa fa-bar-chart-o" aria-hidden="true"></i>信息
                                    </a>


                                    <span
                                            onclick="deleter(<?php echo $_list[$i]['nid'] ?>,'data_delete_process')"
                                            class="layui-btn layui-btn-sm layui-btn-primary">
                                        <i class="layui-icon">&#xe640;</i>删除
                                    </span>
                                </td>

                                
                            </tr>
                        <?php;} ?>

                        <?php //无数据时显示
                            if (count($_list) == 0) { echo "<tr class='no_data'><td colspan='15'>暂无数据</td></tr>"; }
                        ?>

                        </tbody>
                    </table>





                    <!-- todo 这里需要做0判断-->
                    <!-- 翻页代码-->
                    <?php include 'module/page_numbers.php'; ?>


            </div>
            <!--list-box end-->








        <?//============================================?>
        <?//以下JS部分需要根据实际情况去加载?>
        <?//============================================?>
    </div>
    <!--content end-->
    <br class="clearfloat"/>
    <!--container-->
</div>

<?
    //==============================================================================
    //JS加载区域
    //==============================================================================
?>

<!--载入删除功能-->
<script type="text/javascript" src="/controller/common/asset/js/deleter.js"></script>
<!--载入弹出窗口功能-->
<script type="text/javascript" src="/controller/common/asset/js/window_eject.js"></script>
<!--载入弹checkbox全选功能；在layui内部实现-->
<script type="text/javascript" src="/controller/common/asset/js/check_all_checkbox.js"></script>
<script type="text/javascript" src="/controller/common/asset/js/mulity_delete_button.js"></script>



<script>
    //layui渲染过的元素，需要在这里写函数

    layui.use('form', function(){
        var form = layui.form;

        //layui中，处理checkbox
        check_all_checkbox(form)

        //监控复选框，选择一个就触发删除按钮
        mulity_delete_button(form)


    });
</script>

<!--底部栏-->
<?php include $_SERVER['DOCUMENT_ROOT']."/controller/common/module/footer.php"; ?>









